
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>本地开发 · NideShop 文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="tumobi@163.com">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="deployment.html" />
    
    
    <link rel="prev" href="environment.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://nideshop.com/docs" target="_blank" class="custom-link">NideShop 文档</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="environment.html">
            
                <a href="environment.html">
            
                    
                    环境要求
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="development.html">
            
                <a href="development.html">
            
                    
                    本地开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="deployment.html">
            
                <a href="deployment.html">
            
                    
                    线上部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="deployment-sinacloud.html">
            
                <a href="deployment-sinacloud.html">
            
                    
                    在新浪云上部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="deployment-ubuntu.html">
            
                <a href="deployment-ubuntu.html">
            
                    
                    在阿里云上部署(Ubuntu)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="deployment-centos.html">
            
                <a href="deployment-centos.html">
            
                    
                    在阿里云上部署(Centos)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="config.html">
            
                <a href="config.html">
            
                    
                    配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="config-wechat.html">
            
                <a href="config-wechat.html">
            
                    
                    微信登录和支付
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >本地开发</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x672C;&#x5730;&#x5F00;&#x53D1;">&#x672C;&#x5730;&#x5F00;&#x53D1;</h1>
<h3 id="&#x73AF;&#x5883;&#x4ECB;&#x7ECD;">&#x73AF;&#x5883;&#x4ECB;&#x7ECD;</h3>
<ul>
<li>&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF; Windows 10 64&#x4F4D;</li>
<li>Node.js 8.9.0 (x64)</li>
<li>MySQL 5.7</li>
<li>&#x6700;&#x65B0;&#x7248;&#x5FAE;&#x4FE1;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177; windows 64</li>
</ul>
<h3 id="&#x5F00;&#x59CB;&#x4F7F;&#x7528;">&#x5F00;&#x59CB;&#x4F7F;&#x7528;</h3>
<ul>
<li>&#x514B;&#x9686;&#x9879;&#x76EE;&#x5230;&#x672C;&#x5730;<pre><code>git clone https://github.com/tumobi/nideshop
</code></pre></li>
<li>&#x521B;&#x5EFA;&#x6570;&#x636E;&#x5E93;nideshop&#x5E76;&#x5BFC;&#x5165;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684;nideshop.sql<pre><code>CREATE SCHEMA `nideshop` DEFAULT CHARACTER SET utf8mb4 ;
</code></pre><blockquote>
<p>&#x6CE8;&#x610F;&#x6570;&#x636E;&#x5E93;&#x5B57;&#x7B26;&#x7F16;&#x7801;&#x4E3A;utf8mb4 </p>
</blockquote>
</li>
<li>&#x66F4;&#x6539;&#x6570;&#x636E;&#x5E93;&#x914D;&#x7F6E;
src/common/config/adapter.js</li>
</ul>
<pre><code>  /**
 * model adapter config
 * @type {Object}
 */
exports.model = {
  type: &apos;mysql&apos;,
  common: {
    logConnect: isDev,
    logSql: isDev,
    logger: msg =&gt; think.logger.info(msg)
  },
  mysql: {
    handle: mysql,
    database: &apos;nideshop&apos;,
    prefix: &apos;nideshop_&apos;,
    encoding: &apos;utf8mb4&apos;,
    host: &apos;127.0.0.1&apos;,
    port: &apos;3306&apos;,
    user: &apos;root&apos;,
    password: &apos;root&apos;,
    dateStrings: true
  }
};
</code></pre><ul>
<li><p>&#x586B;&#x5199;&#x5FAE;&#x4FE1;&#x767B;&#x5F55;&#x548C;&#x5FAE;&#x4FE1;&#x652F;&#x4ED8;&#x914D;&#x7F6E;
src/common/config/config.js</p>
<pre><code>// default config
module.exports = {
default_module: &apos;api&apos;,
weixin: {
  appid: &apos;&apos;, // &#x5C0F;&#x7A0B;&#x5E8F; appid
  secret: &apos;&apos;, // &#x5C0F;&#x7A0B;&#x5E8F;&#x5BC6;&#x94A5;
  mch_id: &apos;&apos;, // &#x5546;&#x6237;&#x5E10;&#x53F7;ID
  partner_key: &apos;&apos;, // &#x5FAE;&#x4FE1;&#x652F;&#x4ED8;&#x5BC6;&#x94A5;
  notify_url: &apos;&apos; // &#x5FAE;&#x4FE1;&#x5F02;&#x6B65;&#x901A;&#x77E5;&#xFF0C;&#x4F8B;&#xFF1A;https://www.nideshop.com/api/pay/notify
}
};
</code></pre></li>
<li><p>&#x5B89;&#x88C5;&#x4F9D;&#x8D56;&#x5E76;&#x542F;&#x52A8;</p>
<pre><code>npm install
npm start
</code></pre><p>&#x8BBF;&#x95EE;<a href="http://127.0.0.1:8360/" target="_blank">http://127.0.0.1:8360/</a></p>
</li>
</ul>

                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="environment.html" class="navigation navigation-prev " aria-label="Previous page: 环境要求">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="deployment.html" class="navigation navigation-next " aria-label="Next page: 线上部署">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"本地开发","level":"1.3","depth":1,"next":{"title":"线上部署","level":"1.4","depth":1,"path":"deployment.md","ref":"deployment.md","articles":[{"title":"在新浪云上部署","level":"1.4.1","depth":2,"path":"deployment-sinacloud.md","ref":"deployment-sinacloud.md","articles":[]},{"title":"在阿里云上部署(Ubuntu)","level":"1.4.2","depth":2,"path":"deployment-ubuntu.md","ref":"deployment-ubuntu.md","articles":[]},{"title":"在阿里云上部署(Centos)","level":"1.4.3","depth":2,"path":"deployment-centos.md","ref":"deployment-centos.md","articles":[]}]},"previous":{"title":"环境要求","level":"1.2","depth":1,"path":"environment.md","ref":"environment.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","-lunr","-highlight","sitemap"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"sitemap":{"hostname":"https://nideshop.com/docs"},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"tumobi@163.com","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NideShop 文档","language":"zh-hans","links":{"sidebar":{"NideShop 文档":"https://nideshop.com/docs"}},"gitbook":"*","description":"NideShop：基于Node.js+MySQL开发的开源微信小程序商城"},"file":{"path":"development.md","mtime":"2018-01-14T03:34:32.247Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-14T03:58:28.036Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

